package krypto.blindsignature.client;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import java.math.BigInteger;

import krypto.blindsignature.key.PublicKey;

import org.junit.Before;
import org.junit.Test;
import org.springframework.context.support.FileSystemXmlApplicationContext;

public class BlindSignatureServiceClientTestCase {

	BlindSignatureServiceClient client;

	@Before
	public void setUp() {
		FileSystemXmlApplicationContext ctx = new FileSystemXmlApplicationContext(
				"src/test/resources/application-context2.xml");
		client = (BlindSignatureServiceClientImpl) ctx
				.getBean("blindSignClient");
	}

	@Test
	public void testGetPublicKey() {

		PublicKey key = client.getPublicKey("ja");
		assertNotNull(key.getKey());
		assertNotNull(key.getN());

	}

	@Test
	public void testSignMessage() {
		assertNotNull(client.signMessage(new BigInteger("666")));
	}

}
